package com.mikao.controller.feedBack;

import com.mikao.dto.bo.ReqDataTableDto;
import com.mikao.dto.vo.FeedbackDto;
import com.mikao.dto.vo.RspDataTableDto;
import com.mikao.service.FeedbackService;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.*;

/**
 * @author kenny
 */

@RestController
@RequestMapping("/management")
@Scope("prototype")
public class FeedBackController {

    private FeedbackService feedbackService;

    public FeedBackController(FeedbackService feedBackService) {
        this.feedbackService = feedBackService;
    }

    @GetMapping("/feedbackList")
    public RspDataTableDto<FeedbackDto> feedbackList(ReqDataTableDto dataTableDTO,
                                                     @RequestParam(required = false) String dateRangePicker) {
        return feedbackService.feedbackList(dataTableDTO, dateRangePicker);
    }

    @PostMapping("/deleteFeedback/{id}")
    public void deleteFeedback(@PathVariable long id) {
        feedbackService.deleteFeedback(id);
    }
}
